import request from '@/utils/request'
import type { PageParam, ResponseData } from '../commonType'

enum API {
  ALL_URL = '/t-recommender-info/getAll',
  PAGE_URL = '/t-recommender-info/getPage',
  ADD_URL = '/t-recommender-info/add',
  EDIT_URL = '/t-recommender-info/update',
  DELETE_URL = '/t-recommender-info/batchDelete',
}

export function adviseGetAll() {
  return request.get<any, ResponseData>(API.ALL_URL)
}

export function adviseGetPage(data: PageParam) {
  return request.get<any, ResponseData>(API.PAGE_URL, { params: data })
}

export function adviseAdd(data: any) {
  return request.post<any, ResponseData>(API.ADD_URL, data)
}

export function adviseEdit(data: any) {
  return request.put<any, ResponseData>(API.EDIT_URL, data)
}

export function adviseDelete(ids) {
  return request.delete<any, ResponseData>(API.DELETE_URL, { data: { ids } })
}
